﻿@model ConferenceLogInfoModel
@{
	ViewBag.Title = Resources.ConferenceLogInfo + ConstValues.strDash + ViewBag.ConferenceName;
}
<div id="menuBar" style="height:35px;">
	<div style="float: left; padding: 5px 5px; font-weight: bold; text-align: left;">
		@Resources.LogsAction：<input id="selAction" class="easyui-textbox" style="height:27px; width:200px;" />&nbsp;&nbsp;
		@Resources.LogsView：<input id="selView" class="easyui-textbox" style="height:27px; width:200px;" />&nbsp;&nbsp;
		@Resources.LogsController：<input id="selController" class="easyui-textbox" style="height:27px; width:200px;" />&nbsp;&nbsp;
		<a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" onclick="searchData();">@Resources.Search</a>&nbsp;&nbsp;
		<input type="hidden" id="hidSelect" />
		<input type="hidden" id="hidConferenceId" name="conferenceId" />
	</div>
	<div class="clear"></div>
</div>
<div id="dataGrid"></div>

@section Scripts {
<script>
	common.setCurrentMenu("ConferenceLogInfo");

	$(function () {
		$("#hidConferenceId").val("@Model.ConferenceId");

		$("#selAction").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		$("#selView").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		$("#selController").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		$("#dataGrid").datagrid({
			url: "@Url.Action(nameof(ConferenceLogInfoController.GetData),
					nameof(ConferenceLogInfoController).GetControllerName())",
			method: "get",
			singleSelect: true,
			//fitColumns: true,
			width: $(window).width() - 285,
			height: $(window).height() - 158,
			nowrap: false,
			pagination: true,
			remoteSort:true,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#toolBar",
			pageSize: 100, 
			pageList: [100, 200, 300, 400, 500],
			columns: [[
				{ field: "id", title: "ID", hidden: true },
				{ field: "pageLogsType", title: "@Resources.PageLogsType", align: "center", sortable: true, width: 150 },
				{ field: "action", title: "@Resources.LogsAction", align: "center", sortable: true, width: 150 },
				{ field: "view", title: "@Resources.LogsView", align: "left", sortable: true, width: 300 },
				{ field: "controller", title: "@Resources.LogsController", align: "left", sortable: true, width: 300 },
				{ field: "path", title: "@Resources.LogsPath", align: "left", sortable: true, width: 600 },
				{ field: "client", title: "@Resources.LogsClient", align: "center", sortable: true, width: 100 },
				{
					field: "status", title: "@Resources.Status", align: "center", sortable: true, width: 100,
					formatter: function(value, rec) {
				    		if (value=="@ConstValues.Status.正常") {
				    			return "@Resources.Normal"
				    		} else {
				    			return "@Resources.Pause"
				    		}
					}
				},
				{ field: "sort", title: "@Resources.Sort", align: "center", sortable: true, width: 100 },
				{ field: "remark", title: "@Resources.Remark", align: "center", sortable: true, width: 200 },
				{ field: "creator", title: "@Resources.Creator", align: "center", sortable: true, width: 150 },
				{ field: "createIP", title: "@Resources.CreateIP", align: "center", sortable: true, width: 150 },
				{ field: "createDate", title: "@Resources.CreateDate", align: "center", sortable: true, width: 150 }
			]],
			onBeforeLoad: function(param) {
				param.random = Math.random();
				param.conferenceId = $("#hidConferenceId").val();
			}
		});

		$(window).resize(function () {
			$("#dataGrid").datagrid("resize", {
				width: $(window).width() - 285,
				height: $(window).height() - 158
			});
		});
	});

	function searchData() {
		$("#hidSelect").val("select");
		$("#dataGrid").datagrid("load", {
			SelAction: $("#selAction").textbox("getValue"),
			SelView: $("#selView").textbox("getValue"),
			SelController: $("#selController").textbox("getValue")
		});
	}
</script>
}